package com.panshi.controller;

import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.panshi.service.IAdminApp;
import com.panshi.service.IRoleApp;
import com.panshi.vo.DataResult;
import com.panshi.vo.SysAdmin;
import com.panshi.vo.SysRole;
import com.panshi.vo.WebAdmin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@CrossOrigin
public class AdminController {

    @Resource
    private IAdminApp adminApp;

    @GetMapping(value = "/admin-app/list")
    public DataResult findAdmin(){
       return adminApp.findAdmin();
    }

    @GetMapping("/admin-app/grade")
    public List<SysAdmin> findAdminGrade(){
        return adminApp.findAdminGrade();
    }

/*    @GetMapping(value = "/role-app/list")
    public DataResult findRole(){
       return adminApp.fidnRole();
    }*/

    @GetMapping("/admin-app/del/{id}")
    public Boolean delAdmin(@PathVariable("id") Integer id){
        return adminApp.del(id);
    }

}
